<?php

namespace frontend\modules\dynamic\controllers;

use Yii;
use frontend\components\Controller;
use frontend\models\DynamicSearch;
use frontend\models\DynamicRetweetSearch;
use frontend\models\DynamicLikeSearch;
use frontend\models\DynamicCommentSearch;

/**
 * 动态详情相关
 * DynamicController controller for the `h5` module
 */
class ViewController extends Controller {

    public $modelClass = 'frontend\models\DynamicCommentSearch';

    /**
     * @inheritdoc
     */
    public function actionIndex($id) {
        return DynamicSearch::findOne($id);
    }

    /**
     * @inheritdoc
     */
    public function actionLikes($id) {
        $modelClass = new DynamicLikeSearch();
        return $modelClass->search($id);
    }

    /**
     * @inheritdoc
     */
    public function actionComments($id) {
        $modelClass = new DynamicCommentSearch($id);
        return $modelClass->search($id);
    }

    /**
     * @inheritdoc
     */
    public function actionRetweets($id) {
        $modelClass = new DynamicRetweetSearch();
        return $modelClass->search($id);
    }

}
